<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      
      // 2
      const obj = { label: "男", value: 1, age: 18 };
      function f(obj) {
        // 写代码，得到
        const arr = [];
        Object.keys(obj).forEach((ele) => {
          arr.push(obj[ele]);
        });
        return arr;
      }
      var arr = f(obj);
      console.log(arr);
      // arr = ['男', '1', '18'] // 所有的属性值取出来，保存在数组中


     
    </script>
  </body>
</html>
